
import Vue from 'vue';
import VueRouter from 'vue-router';
import VueResource from 'vue-resource';
import App from './App';
// components 会依据base配置的路径别名来查找
import goods from 'components/goods/goods';
import ratings from 'components/ratings/ratings';
import seller from 'components/seller/seller';
// 引入公共样式  common依据base配置的路径别名来查找
import 'common/stylus/index.styl';

// 以阻止 vue 在启动时生成生产提示(2.2.0新增)
Vue.config.productionTip = false;

Vue.use(VueRouter);
Vue.use(VueResource);

// 1. 定义路由(先提前准备好对应的组件)
// 2. 创建 router 实例，然后传 `routes` 配置
const router = new VueRouter({
  // 指定tab切换时激活状态下的a标签class样式
  linkActiveClass: 'active',
  routes: [
    { path: '/goods', component: goods },
    { path: '/ratings', component: ratings },
    { path: './seller', component: seller },
    { path: '/', redirect: '/goods' }
  ]
});

new Vue({
  router,
  // 引用app模板
  template: '<App/>',
  components: { App }
}).$mount('#app');
